package com.banciyuan.bcywebview.base.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;

import com.banciyuan.bcywebview.R;
import com.banciyuan.bcywebview.base.view.ProgressWheel;

/**
 * Created by squall on 2015/10/22.
 */
public class DownLoadProgressDialog extends Dialog {

    private boolean cancel_flag=false;

    public DownLoadProgressDialog(Context context) {
        super(context);
    }

    public DownLoadProgressDialog(Context context, int theme) {
        super(context, theme);
    }

    protected DownLoadProgressDialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    private ProgressWheel progressWheel;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.pop_download);
        progressWheel= (ProgressWheel) findViewById(R.id.progressBarTwo);
        progressWheel.startSpinning();
    }

    public void process(int length){
        progressWheel.setText(String.valueOf(length) + "%");
    }

    public void setCancel_flag(){
        cancel_flag=true;
    }

    public boolean getCancel_flag(){
        return cancel_flag;
    }

}
